/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package CastleDefense;

//import javax.xml.bind.annotation.XmlElement;
import CastleDefense.Enemy.MonsterType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement(name = "wave")
// If you want you can define the order in which the fields are written
// Optional
@XmlType(propOrder = {"name", "sprite", "size", "hp", "armor" , "mArmor", "speed",
                      "bounty", "damage", "boss", "bossId", "type"})
public class Monster
{
    private String   name;
    private String   sprite;
    private String   size;
    private int      hp;
    private int      armor;
    private int      mArmor;
    private int      speed;
    private int      bounty;
    private int      damage;
    private boolean  boss;
    private int      bossId;
    private int      type;

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getSprite()
    {
        return sprite;
    }

    public void setSprite(String url)
    {
        this.sprite = url;
    }

    @XmlElement(name = "size")
    public String getSize()
    {
        return size;
    }

    public void setSize(String size)
    {
        this.size = size;
    }

    @XmlElement(name = "hp")
    public int getHp()
    {
        return hp;
    }

    public void setHp(int hp)
    {
        this.hp = hp;
    }

    @XmlElement(name = "armor")
    public int getArmor()
    {
        return armor;
    }

    public void setArmor(int armor)
    {
            this.armor = armor;
    }

    @XmlElement(name = "mArmor")
    public int getmArmor()
    {
        return mArmor;
    }

    public void setmArmor(int mar)
    {
        this.mArmor = mar;
    }

    @XmlElement(name = "speed")
    public int getSpeed()
    {
        return speed;
    }

    public void setSpeed(int spd)
    {
        this.speed = spd;
    }

    @XmlElement(name = "bounty")
    public int getBounty()
    {
        return bounty;
    }

    public void setBounty(int b)
    {
        this.bounty = b;
    }

    public int getDamage()
    {
        return damage;
    }

    public void setDamage(int dmg)
    {
        this.damage = dmg;
    }

    public boolean getBoss()
    {
            return boss;
    }

    public void setBoss(boolean boss)
    {
        this.boss = boss;
    }

    @XmlElement(name = "bossId")
    public int getBossId()
    {
        return bossId;
    }

    public void setBossId(int bid)
    {
        this.bossId = bid;
    }

    @XmlElement(name = "type")
    public int getType()
    {
        return type;
    }

    public MonsterType getMobType()
    {
        switch(this.getType())
        {
            case 0:
                return MonsterType.NORMAL;
            case 1:
                return MonsterType.FLYING;
            case 2:
                return MonsterType.GHOST;
            case 3:
                return MonsterType.MAGIC_IMMUNE;
            default:
                return MonsterType.NORMAL;
        }
    }

    public void setType(int type)
    {
        this.type = type;
    }

    public String getAllData()
    {
        String data = ""+getName()
                     +"\n"+getSprite()
                     +"\n"+getHp()
                     +"\n"+getArmor()
                     +"\n"+getmArmor()
                     +"\n"+getSpeed()
                     +"\n"+getBounty()
                     +"\n"+getDamage()
                     +"\n"+getBoss()
                     +"\n"+getBossId()
                     +"\n"+getType()+"\n";

        return data;
    }
}
